package com.trainfinder.database;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;

public class DateItem {
	private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(
			"EEEE, d MMM yyyy");

	private final Date date;

	private Collection<Line> lines = new ArrayList<Line>();

	public DateItem(Date date) {
		this.date = (Date) date.clone();

	}

	public String getDate() {
		return DATE_FORMAT.format(date);
	}

	public String getIsSaturday() {
		Calendar c = Calendar.getInstance();
		c.setTime(date);
		return (c.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) ? "true"
				: "false";
	}

	public Collection<Line> getLines() {
		return lines;
	}

	public void setLines(Collection<Line> lines) {
		this.lines = lines;
	}

	public static void main(String[] args) {
		System.out.println(new DateItem(new Date()).getIsSaturday());
	}

}
